package com.ry.est.controller;

import com.ry.est.dto.CommonResult;
import com.ry.est.service.SmsVerifyCodeService;
import com.ry.est.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 验证码控制器
 */
@RestController
@RequestMapping("/api/sms")
public class SmsVerifyCodeController {

    @Autowired
    private SmsVerifyCodeService smsVerifyCodeService;

    //...todo
    @PostMapping("/verifyCode")
    public CommonResult<Void> sendVerifyCode(@RequestParam(required = true,value = "phone") String phone,
                                             @RequestParam(required = true,value = "codeType") Integer codeType){
        smsVerifyCodeService.sendVerifyCode(phone,codeType);
        return ResultUtil.success();
    }
}
